﻿
namespace Edu.Technion.CSE.OpenUnit4.CollectionsLib
{
    /// <summary>
    /// 
    /// </summary>
    /// <typeparam name="K"></typeparam>
    /// <typeparam name="V"></typeparam>
    class Pair<K, V>
    {
        // members

        private K key;
        private V value;

        // Constructors

        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        public Pair(K key, V value)
        {
            this.key = key;
            this.value = value;
        }

        // Public Methods

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public K GetKey()
        {
            return key;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public V GetValue()
        {
            return value;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="newKey"></param>
        public void SetKey(K newKey)
        {
            key = newKey;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="newValue"></param>
        public void SetValue(V newValue)
        {
            this.value = newValue;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return (key + ", " + value);
        }
    }

 

}
